/* 
 * File:   MainWindow.h
 * Author: Morpheus
 *
 * Created on 20 juin 2013, 13:19
 */

#ifndef _MAINWINDOW_H
#define	_MAINWINDOW_H

#include "ui_MainWindow.h"
#include "MyBatchSetting.h"

class MergeMdiChild;
class BatchMergeCriteria;

class MainWindow : public QMainWindow {
    Q_OBJECT
public:
    MainWindow();
    virtual ~MainWindow();
    
    void initialed();
    
protected:
    void closeEvent(QCloseEvent* );
    
Q_SIGNALS:
    void showMessage(const QString&, int alignment = Qt::AlignLeft | Qt::AlignBottom, const QColor &color = Qt::black);
    
public Q_SLOTS:
    void on_actionAddFolder_triggered();
    void on_actionRemoveFile_triggered();
//    void OnFilterChanged(QString);
    void OnBatchUpdated(const QByteArray&);
    void OnThreadFinishWthSuccessOneBatch(const int&);
    void on_actionEditConfig_triggered();
    void on_actionAddFiles_triggered();
    void on_actionExecutSelectedBatch_triggered();
    void on_actionExecutAllBatch_triggered();
    void on_actionCreateBatch_triggered();
    void on_actionDeleteBatch_triggered();
    void on_actionAbout_triggered();
    void on_actionAboutQt_triggered();
    void on_actionAddFilter_triggered();
    void on_listView_activated(const QModelIndex &index);
    void updateSubWindow();
    void on_actionCheckAll_triggered();
    void on_actionCheckSelected_triggered();
    void on_actionUnCheckAll_triggered();
    void on_actionUnCheckSelected_triggered();
    void on_comboFilterBatch_currentIndexChanged(const int&);
//    void on__triggered();
private:

    void reloadFilterBatch();
    MergeMdiChild* createMdiChild();
    MergeMdiChild* activeMdiChild();
    QMdiSubWindow* findMdiChild(const int &uuid);
    void setActiveSubWindow(QWidget *window);
    void launchThread(const QByteArray&);
    // return version
    void readSetting();
    void writeSetting();
    
    
    Ui::MainWindow widget;
    QString m_lastDir;
    MyBatchSetting m_batchSetting;
};

#endif	/* _MAINWINDOW_H */
